package org.museum.identity.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.museum.identity.domain.entity.IdentityName;


@Mapper
public interface IdentityNameMapper extends BaseMapper<IdentityName> {
    //插入身份码和名字的映射关系
    @Insert("insert into identity_name(`identity`,name) values (#{identity},#{name})")
    void addIdentityByName(String identity,String name);

    //根据身份码查询名字
    @Select("SELECT `name` FROM identity_name WHERE `identity` = #{idCard}")
    String selectNameByIdCard(String idCard);


}
